add_library(MyPrint STATIC myprint.cpp)

set_property(GLOBAL APPEND_STRING PROPERTY global_var1 "aaaa")
set_property(GLOBAL APPEND PROPERTY global_var2 "bbbb")
get_property(aa GLOBAL PROPERTY global_var1)
get_property(bb GLOBAL PROPERTY global_var2)
message("SubDir global_var1 = ${aa}")
message("SubDir global_var2 = ${bb}")

set_property(DIRECTORY PROPERTY dir_var1 "dir11")
set_property(DIRECTORY .. PROPERTY dir_var2 "dir22")
get_property(aa DIRECTORY PROPERTY dir_var1)
get_property(bb DIRECTORY .. PROPERTY dir_var2)
message("SubDir Directory dir_var1 = ${aa}")
message("SubDir Directory dir_var2 = ${bb}")
